import request from '@/utils/request'

// 获取角色列表
export const getRoleList = (query) => {
  return request({
    url: `/roles?_limit=${query.limit}&_start=${query.start}`
  })
}

// 新建角色
export const addRole = (data) => {
  return request({
    url: '/roles',
    method: 'post',
    data
  })
}
// 删除角色
export const delRole = (id) => {
  return request({
    url: '/roles/' + id,
    method: 'delete'
  })
}
// 编辑角色
export const putRole = (data) => {
  return request({
    url: '/roles/' + data.id,
    method: 'put',
    data
  })
}
// 获取指定角色
export const getRole = (id) => {
  return request({
    url: '/roles/' + id
  })
}
// 获取角色数量
export const getRolesCount = () => {
  return request({
    url: '/roles/count'
  })
}
